package com.myjavalab.sort;

import com.myjavalab.util.DataUtil;
import com.myjavalab.util.PrintUtil;

public class SelectSort {

	public static void sort(int[] ary, int start, int end) {
		PrintUtil.prt(ary);
		for(int i = 0; i <= end; i++) {
			int min = i;
			for(int j = i+1; j <= end; j++) {
				if(ary[j] < ary[min]) {
					min = j;
				}
			}
			DataUtil.swap(ary, i, min);
			PrintUtil.prt(ary);
		}
	}

	public static void main(String[] args) {
		int[] ary = DataUtil.getNumber(100, 10);
		sort(ary,0,ary.length-1);
	}
	
}
